/*
 * Copyright (c) 2019 DawnFramework. All Rights Reserved.
 * Licensed under the MIT (LICENSE) license.
 */

package org.dawn.common.web.view;

import org.dawn.common.web.model.PageModel;

import java.util.List;

public class PageView<T> extends PageModel<T> {
    private static final long serialVersionUID = 1562135867873099441L;

    /** 屏蔽构造函数 */
    private PageView() {
    }

    /**
     * PageView 构造方法
     */
    public static <T> PageView<T> newPageView(List<T> model,
                                              int page,
                                              int rows,
                                              int totalCount,
                                              int totalPage) {
        PageView<T> rt = new PageView<>();
        rt.page = page;
        rt.rows = rows;
        rt.totalCount = totalCount;
        rt.totalPage = totalPage;
        rt.model = model;
        return rt;
    }
}
